<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="/css/main/table.css"/>
<link rel="stylesheet" href="/css/main/page.css"/>
<link rel="stylesheet" href="/css/common/list.css"/>
<script type="text/javascript" src="${ctx}/plugin/jquery/jquery-2.1.1.js"></script>
<script type="text/javascript" src="${ctx}/plugin/layer-v1.9.2/layer/layer.js"></script>
<script type="text/javascript" src="${ctx}/js/page.js"></script>
<script type="text/javascript" src="${ctx}/js/task/taskList.js"></script>

<body>
<div>
    <div class="top-title">
    <#if taskType ==1 >
        <span>检查任务 / Inspection Task</span>
    </#if>
    <#if taskType ==2 >
        <span>整改任务 / Rectification Task</span>
    </#if>
    <#if taskType ==3 >
        <span>闭环任务 / Closed Loop Task</span>
    </#if>
    </div>
    <div class="list-group">
        <table id="dynamic-table" class="table table-stripe" role="grid"
               aria-describedby="dynamic-table_info">
            <thead>
            <tr role="row" style=" background: #CDD9D9;" class="tableHead">
                <th width="20px" tabindex="0" rowspan="1" colspan="1"></th>
                <th width="460px" tabindex="0" rowspan="1" colspan="1">名称</th>
                <th width="145px" tabindex="0" rowspan="1" colspan="1">开始时间</th>
                <th width="145px" tabindex="0" rowspan="1" colspan="1">结束时间</th>
            <#if taskType ==3 >
                <th width="100px" tabindex="0" rowspan="1" colspan="1">是否闭环</th>
            </#if>
            </tr>
            </thead>
            <tbody>
            <#list taskList as task>
            <tr role="row" class="odd">

                <td><i class="task-icon"></i></td>
                <td><a href="/taskManage/checkItem?taskType=${taskType}&taskId=${task.id}">${task.caption}</a></td>
                <td><b>${task.startTime?string('yyyy-MM-dd HH:mm')}</b></td>
                <td><b>${task.endTime?string('yyyy-MM-dd HH:mm')}</b></td>
                <#if taskType ==3 >

                <#--<td><b>${task.getDo?string("已闭环","未闭环")}</b></td>-->
                    <#if task.loopDo =="1" >
                        <td><b>已闭环</b></td>
                    <#else>
                        <td><b>未闭环</b></td>
                    </#if>
                </#if>
            </tr>
            </#list>
            </tbody>
        </table>
    </div>
    <div class="row">
        <div class="page-info" id="table_info">
        <#--第${nowBegin}-${nowEnd}条，共${count}条-->
        </div>
    </div>
    <div class="row">
        <div class="page-info" id="table_info">
        <#if taskType ==1 >
            <button id="releaseTask" class="down-button-add">发布任务</button>
        </#if>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    <#--new page({pageMain:"pagination",nowPage:${page!'1'},count:${count},pageSize:${pageSize!'10'},-->
    <#--url:"/admin/user",params:"?pageSize=${pageSize}&query=${query}",pakey:"page"});-->

    new tablePage(${page} ,${pageSize} ,${count?c}  , getUul(), getParams());

    function getUul() {
        var taskType =${taskType};
        if (taskType == 2) {
            return '${ctx}/taskManage/rectificationTask?'
        } else if (taskType == 3) {
            return '${ctx}/taskManage/closedLoopTask?'
        } else {
            return '${ctx}/taskManage/inspectTask?'
        }
    }
    function getParams() {
        return "taskType=" +${taskType};
    }
    <#--function lookDetails(id) {-->
    <#--window.open("${ctx}/homepage/getphotoListDetails?projectId="+id);-->
    <#--}-->
</script>
</html>
